package qdu.edu.com.fushanf4.service.count.range;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import qdu.edu.com.fushanf4.utils.ConfigurationUtil;
import qdu.edu.com.fushanf4.utils.DriverUtil;

import java.io.IOException;

public class RangeOfCharactersNumberDriver extends DriverUtil {
    public static void main(String[] args) throws IOException {
        RangeOfCharactersNumberDriver rangeOfCharactersNumberDriver = new RangeOfCharactersNumberDriver();
        rangeOfCharactersNumberDriver.run(args);
    }


    @Override
    public Job runJob(String[] path) throws IOException {
         Job job = ConfigurationUtil.getJob();

         //设置Driver类
        job.setJarByClass(RangeOfCharactersNumberDriver.class);

        // 设置Mapper和Reduce类
         job.setMapperClass(RangeOfCharactersNumberMapper.class);
         job.setReducerClass(RangeOfCharactersNumberReduce.class);

         // 设置输出
         job.setMapOutputKeyClass(Text.class);
         job.setMapOutputValueClass(IntWritable.class);
         job.setOutputKeyClass(Text.class);
         job.setOutputValueClass(IntWritable.class);

         assert ConfigurationUtil.setPathAndRunJob(path,job);
         return job;
    }
}
